<template>
	<view class="order-bz-list">

		<view class="box bz-list" :style="{'height': bzOrderListHeight}">


			<ListTools :total="count" :sedate="{st: startTime, et: endTime}" @selDate="selAlSeDate">
			</ListTools>

			<z-paging ref="paging" v-model="dg.list" @query="getOrderBzList" :fixed="false"
				:empty-view-style="{'top': '80rpx'}" style="height: 100%;"
				:paging-style="{'background-color':'#ffffff'}">

				<view class="sel-plate-num" slot="top">

					<label class="title">
						请选择报账车牌号
						<u-button v-if="plateNum != carMd.myPlateNum" size="mini"
							:custom-style="{'vertical-align': '6rpx', 'margin-left': '20rpx', 'color': '#fff', 'background': '#00c3ce'}"
							@click="setCarPlateNum({show: false, obj: carMd.myPlateNum})">
							我的车辆
						</u-button>
					</label>
					<label class="plate-num" @click="setCarPlateNum({show: true})">{{plateNum}} <u-icon
							name="arrow-right" color="#999"></u-icon></label>
				</view>

				<u-radio-group v-model="dg.selId" :active-color="'#00c3ce'" :style="{'width': '100%'}">
					<view class="bz-item" v-for="(it, index) in dg.list" :key="index" @click="selBzItem(it)">

						<view class="it-main">
							<u-radio :name="it.id" class="it-radio"></u-radio>
							<view class="it-con">
								<view class="it-text" :class="{'c-qgreen': dg.selId == it.id}">
									{{it.startTime}} {{it.routeSimpleName}}
								</view>
								<!-- 	<view v-if="dg.moreId == it.id" class="it-detail"
									:class="{'c-qgreen': dg.selId == it.id}"
									v-html="it.routeDetail.replace(/@/g, '<br />')"></view> -->
								<view v-if="dg.moreId == it.id" class="it-detail"
									:class="{'c-qgreen': dg.selId == it.id}" v-html="it.routeDetail"></view>
							</view>

							<view class="it-more" @click="dg.moreId = (it.id == dg.moreId ? null : it.id)">
								更多<u-icon name="arrow-right-double" color="#999"></u-icon>
							</view>
						</view>

						<view class="it-btns" v-if="dg.selId == it.id">
							<u-button :hover-class="'none'" :custom-style="{'color': '#ff6300'}" :size="'mini'"
								@click="showRouteBzMd(it)">
								<u-icon name="order" color="#ff6300"
									:custom-style="{'margin-right': '5rpx'}"></u-icon>报账
							</u-button>

							<u-button :hover-class="'none'" :custom-style="{'color': '#00c3ce'}" :size="'mini'"
								:data-obj="{index: index, order: it}"
								@click="setRouteBzState({index: index, order: it})">无需报账/完成报账
								<u-icon name="checkbox-mark" color="#00c3ce"
									:custom-style="{'margin-left': '5rpx'}"></u-icon>
							</u-button>
						</view>
					</view>
				</u-radio-group>
			</z-paging>
		</view>

		<view class="bz-fm">
			<u-collapse v-model="activeNames" ref="uCollspan">
				<u-collapse-item :title="'加油记账'" name='加油记账'>
					<view class="aaa" style="width: 100%;" slot="title">

						<view style='display: flex;justify-content: space-between;'>
							<view>加油记账</view>
							<u-button @click="clear_btn('加油记账')" size="mini" type="warning">清空加油记账</u-button>
						</view>

					</view>
					<u-form :model="fm.jyjz" ref="jyjzfm">
						<view class="my-fm">
							<view class="f-item" :style="{'margin': '0rpx', 'padding': '0rpx'}">
								<u-form-item>
									<view class="i-row">
										<view class="r-title">公里数</view>
										<view class="r-con">
											<u-input v-model="fm.jyjz.currentKilo" :type="'digit'" :maxlength="8"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" placeholder="加油车辆公里数" /><label
												class="i-r-text">公里</label>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">加油方式</view>
										<view class="r-con">
											<MySelect :title="'加油方式'" :name="'jyjz.jyWay'" :list="fm.jyWayList"
												:defval="fm.jyjz.jyWay" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>

								<template v-if="fm.jyjz.jyWay.val != 'XJ_JY'">
									<u-form-item>
										<view class="i-row">
											<view class="r-title">加油站</view>
											<view class="r-con">
												<MySelect :title="'加油站'" :name="'jyjz.jyStation'"
													:list="fm.jyStationList" :defval="fm.jyjz.jyStation"
													@seledItem="mySeledMd"></MySelect>
											</view>
										</view>
									</u-form-item>


								</template>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">加油金额</view>
										<view class="r-con">
											<u-input v-model="fm.jyjz.reimMoney" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入加油金额'" /><label
												class="i-r-text">元</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">加油数量</view>
										<view class="r-con">
											<u-input v-model="fm.jyjz.jyCount" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入加油数量'" /><label
												class="i-r-text">升</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">加油日期</view>
										<view class="r-con">
											<MyDateTime :name="'jyjz.jyDate'" :showType="1" :datePlaceholder="'加油日期'"
												:dateTime="fm.jyjz.jyDate" @myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row-textarea">
										<view class="r-title">备注</view>
										<view class="r-con">
											<u-input v-model="fm.jyjz.remark" :type="'textarea'"
												:custom-style="{'color': '#00C3CE'}"
												:placeholderStyle="'color: #f000000;'" :clearable="false"
												:auto-height="true" :height="150" :maxlength="200"
												:placeholder="'请填写备注，最多输入200个字（选填）'" />
										</view>
									</view>
								</u-form-item>

								<u-form-item :border-bottom="false">
									<view class="i-row-textarea">
										<view class="r-title">加油凭证<label class="r-title-tip">（最多上传6张图片）</label></view>
										<view class="r-con">
											<u-upload ref="jyjzUf" width="200" height="200" max-count="6"
												:file-list="fm.jyjz.uflist" :action="fm.ufAction" :header="fm.ufHeader"
												:name="'file'" :form-data="{ftype: 'BACK_SET_DATA_IMG',}"
												:max-size="1024*1024*30"></u-upload>
										</view>
									</view>
								</u-form-item>

							</view>
						</view>
					</u-form>
				</u-collapse-item>

				<u-collapse-item :open="wxjzfm_open" :title="'维修记账'" name='维修记账' ref="wxjzCollItem">
					<view class="aaa" style="width: 100%;" slot="title">

						<view style='display: flex;justify-content: space-between;'>
							<view>维修记账</view>
							<u-button @click="clear_btn('维修记账')" size="mini" type="warning">清空维修记账</u-button>
						</view>

					</view>
					<u-form :model="fm.wxjz" ref="wxjzfm">
						<view class="my-fm">
							<view class="f-item" :style="{'margin': '0rpx', 'padding': '0rpx'}">
								<u-form-item>
									<view class="i-row">
										<view class="r-title">公里数</view>
										<view class="r-con">
											<u-input v-model="fm.wxjz.currentKilo" :type="'digit'" :maxlength="8"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" placeholder="维修车辆公里数" /><label
												class="i-r-text">公里</label>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">维修站</view>
										<view class="r-con">
											<MySelect :title="'维修站'" :name="'wxjz.wxStation'" :list="fm.wxStationList"
												:defval="fm.wxjz.wxStation" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">维修日期</view>
										<view class="r-con">
											<MyDateTime :name="'wxjz.wxDate'" :showType="1" :datePlaceholder="'维修日期'"
												:dateTime="fm.wxjz.wxDate" @myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">支付方式</view>
										<view class="r-con">
											<MySelect :title="'支付方式'" :name="'wxjz.wxPayWay'" :list="fm.payWayList"
												:defval="fm.wxjz.wxPayWay" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>



								<u-form-item>
									<view class="i-row">
										<view class="r-title">维修金额</view>
										<view class="r-con">
											<u-input v-model="fm.wxjz.reimMoney" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入加油金额'" /><label
												class="i-r-text">元</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">是否保养</view>
										<view class="r-con">
											<MySelect :title="'是否保养'" :name="'wxjz.isMaintenance'"
												:list="fm.isMaintenanceList" :defval="fm.wxjz.isMaintenance"
												@seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row-textarea">
										<view class="r-title">维修备注</view>
										<view class="r-con">
											<u-input v-model="fm.wxjz.remark" :type="'textarea'"
												:custom-style="{'color': '#00C3CE'}"
												:placeholderStyle="'color: #f000000;'" :clearable="false"
												:auto-height="true" :height="150" :maxlength="200"
												:placeholder="'请填写维修备注，最多输入200个字（选填）'" />
										</view>
									</view>
								</u-form-item>

								<u-form-item :border-bottom="false">
									<view class="i-row-textarea">
										<view class="r-title">维修凭证<label class="r-title-tip">（最多上传6张图片）</label></view>
										<view class="r-con">
											<u-upload ref="wxjzUf" width="200" height="200" max-count="6"
												:file-list="fm.wxjz.uflist" :action="fm.ufAction" :header="fm.ufHeader"
												:name="'file'" :form-data="{ftype: 'BACK_SET_DATA_IMG',}"
												:max-size="1024*1024*30"></u-upload>
										</view>
									</view>
								</u-form-item>
							</view>
						</view>
					</u-form>
				</u-collapse-item>

				<u-collapse-item :open="scjzfm_open" :title="'审车记账'" name='审车记账' ref="scjzCollItem">
					<view class="aaa" style="width: 100%;" slot="title">

						<view style='display: flex;justify-content: space-between;'>
							<view>审车记账</view>
							<u-button @click="clear_btn('审车记账')" size="mini" type="warning">清空审车记账</u-button>
						</view>

					</view>
					<u-form :model="fm.scjz" ref="scjzfm">
						<view class="my-fm">
							<view class="f-item" :style="{'margin': '0rpx', 'padding': '0rpx'}">
								<u-form-item>
									<view class="i-row">
										<view class="r-title">公里数</view>
										<view class="r-con">
											<u-input v-model="fm.scjz.currentKilo" :type="'digit'" :maxlength="8"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" placeholder="审车车辆公里数" /><label
												class="i-r-text">公里</label>
										</view>
									</view>
								</u-form-item>



								<u-form-item>
									<view class="i-row">
										<view class="r-title">支付日期</view>
										<view class="r-con">
											<MyDateTime :name="'scjz.scDate2'" :showType="1" :datePlaceholder="'支付日期'"
												:dateTime="fm.scjz.scDate2" @myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">下次到期时间</view>
										<view class="r-con">
											<MyDateTime :name="'scjz.scDate'" :showType="1" :datePlaceholder="'下次到期时间'"
												:dateTime="fm.scjz.scDate" @myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">提前提醒天数</view>
										<view class="r-con">
											<u-input v-model="fm.scjz.remindDays" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入提前提醒天数'" /><label
												class="i-r-text">天</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">支付方式</view>
										<view class="r-con">
											<MySelect :title="'支付方式'" :name="'wxjz.wxPayWay'" :list="fm.payWayList"
												:defval="fm.scjz.wxPayWay" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>



								<u-form-item>
									<view class="i-row">
										<view class="r-title">审车金额</view>
										<view class="r-con">
											<u-input v-model="fm.scjz.reimMoney" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入审车金额'" /><label
												class="i-r-text">元</label>
										</view>
									</view>
								</u-form-item>


								<u-form-item>
									<view class="i-row-textarea">
										<view class="r-title">审车备注</view>
										<view class="r-con">
											<u-input v-model="fm.scjz.remark" :type="'textarea'"
												:custom-style="{'color': '#00C3CE'}"
												:placeholderStyle="'color: #f000000;'" :clearable="false"
												:auto-height="true" :height="150" :maxlength="200"
												:placeholder="'请填写审车备注，最多输入200个字（选填）'" />
										</view>
									</view>
								</u-form-item>

								<u-form-item :border-bottom="false">
									<view class="i-row-textarea">
										<view class="r-title">审车凭证<label class="r-title-tip">（最多上传6张图片）</label></view>
										<view class="r-con">
											<u-upload ref="scjzUf" width="200" height="200" max-count="6"
												:file-list="fm.scjz.uflist" :action="fm.ufAction" :header="fm.ufHeader"
												:name="'file'" :form-data="{ftype: 'BACK_SET_DATA_IMG',}"
												:max-size="1024*1024*30"></u-upload>
										</view>
									</view>
								</u-form-item>
							</view>
						</view>
					</u-form>
				</u-collapse-item>

				<u-collapse-item :title="'月停车费'" name='月停车费'>
					<view class="aaa" style="width: 100%;" slot="title">

						<view style='display: flex;justify-content: space-between;'>
							<view>月停车费</view>
							<u-button @click="clear_btn('月停车费')" size="mini" type="warning">清空月停车费</u-button>
						</view>

					</view>
					<u-form :model="fm.ytcf" ref="ytcffm">
						<view class="my-fm">
							<view class="f-item" :style="{'margin': '0rpx', 'padding': '0rpx'}">
								<u-form-item>
									<view class="i-row">
										<view class="r-title">公里数</view>
										<view class="r-con">
											<u-input v-model="fm.ytcf.currentKilo" :type="'digit'" :maxlength="8"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" placeholder="当前公里数" /><label
												class="i-r-text">公里</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">开始日期</view>
										<view class="r-con">
											<MyDateTime :name="'ytcf.costStartTime'" :showType="1"
												:datePlaceholder="'开始日期'" :dateTime="fm.ytcf.costStartTime"
												@myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">结束日期</view>
										<view class="r-con">
											<MyDateTime :name="'ytcf.costEndTime'" :showType="1"
												:datePlaceholder="'结束日期'" :dateTime="fm.ytcf.costEndTime"
												@myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">停车费用</view>
										<view class="r-con">
											<u-input v-model="fm.ytcf.reimMoney" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入停车费用'" /><label
												class="i-r-text">元</label>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">支付方式</view>
										<view class="r-con">
											<MySelect :title="'支付方式'" :name="'ytcf.payWay'" :list="fm.payWayList"
												:defval="fm.ytcf.payWay" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row-textarea">
										<view class="r-title">备注</view>
										<view class="r-con">
											<u-input v-model="fm.ytcf.jzRemark" :type="'textarea'"
												:custom-style="{'color': '#00C3CE'}"
												:placeholderStyle="'color: #f000000;'" :clearable="false"
												:auto-height="true" :height="150" :maxlength="200"
												:placeholder="'请填写备注，最多输入200个字（选填）'" />
										</view>
									</view>
								</u-form-item>

								<u-form-item :border-bottom="false">
									<view class="i-row-textarea">
										<view class="r-title">凭证图片<label class="r-title-tip">（最多上传6张图片）</label></view>
										<view class="r-con">
											<u-upload ref="ytcfUf" width="200" height="200" max-count="6"
												:file-list="fm.ytcf.uflist" :action="fm.ufAction" :header="fm.ufHeader"
												:name="'file'" :form-data="{ftype: 'BACK_SET_DATA_IMG', }"
												:max-size="1024*1024*30"></u-upload>
										</view>
									</view>
								</u-form-item>
							</view>
						</view>
					</u-form>
				</u-collapse-item>

				<u-collapse-item :title="'月洗车费'" name='月洗车费'>
					<view class="aaa" style="width: 100%;" slot="title">

						<view style='display: flex;justify-content: space-between;'>
							<view>月洗车费</view>
							<u-button @click="clear_btn('月洗车费')" size="mini" type="warning">清空月洗车费</u-button>
						</view>

					</view>
					<u-form :model="fm.yxcf" ref="yxcffm">
						<view class="my-fm">
							<view class="f-item" :style="{'margin': '0rpx', 'padding': '0rpx'}">
								<u-form-item>
									<view class="i-row">
										<view class="r-title">公里数</view>
										<view class="r-con">
											<u-input v-model="fm.yxcf.currentKilo" :type="'digit'" :maxlength="8"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" placeholder="当前公里数" /><label
												class="i-r-text">公里</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">开始日期</view>
										<view class="r-con">
											<MyDateTime :name="'yxcf.costStartTime'" :showType="1"
												:datePlaceholder="'开始日期'" :dateTime="fm.yxcf.costStartTime"
												@myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">结束日期</view>
										<view class="r-con">
											<MyDateTime :name="'yxcf.costEndTime'" :showType="1"
												:datePlaceholder="'结束日期'" :dateTime="fm.yxcf.costEndTime"
												@myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">洗车费用</view>
										<view class="r-con">
											<u-input v-model="fm.yxcf.jzMoney" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入洗车费用'" /><label
												class="i-r-text">元</label>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">支付方式</view>
										<view class="r-con">
											<MySelect :title="'支付方式'" :name="'yxcf.payWay'" :list="fm.payWayList"
												:defval="fm.yxcf.payWay" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row-textarea">
										<view class="r-title">备注</view>
										<view class="r-con">
											<u-input v-model="fm.yxcf.jzRemark" :type="'textarea'"
												:custom-style="{'color': '#00C3CE'}"
												:placeholderStyle="'color: #f000000;'" :clearable="false"
												:auto-height="true" :height="150" :maxlength="200"
												:placeholder="'请填写备注，最多输入200个字（选填）'" />
										</view>
									</view>
								</u-form-item>

								<u-form-item :border-bottom="false">
									<view class="i-row-textarea">
										<view class="r-title">凭证图片<label class="r-title-tip">（最多上传6张图片）</label></view>
										<view class="r-con">
											<u-upload ref="yxcfUf" width="200" height="200" max-count="6"
												:file-list="fm.yxcf.uflist" :action="fm.ufAction" :header="fm.ufHeader"
												:name="'file'" :form-data="{ftype: 'BACK_SET_DATA_IMG',}"
												:max-size="1024*1024*30"></u-upload>
										</view>
									</view>
								</u-form-item>
							</view>
						</view>
					</u-form>
				</u-collapse-item>


				<u-collapse-item :title="'其他费用'" name='其他费用'>
					<view class="aaa" style="width: 100%;" slot="title">

						<view style='display: flex;justify-content: space-between;'>
							<view>其他费用</view>
							<u-button @click="clear_btn('其他费用')" size="mini" type="warning">清空其他费用</u-button>
						</view>

					</view>
					<u-form :model="fm.qtjz" ref="qtjzfm">

						<view class="my-fm">
							<view class="f-item" :style="{'margin': '0rpx', 'padding': '0rpx'}">
								<u-form-item>
									<view class="i-row">
										<view class="r-title">公里数</view>
										<view class="r-con">
											<u-input v-model="fm.qtjz.currentKilo" :type="'digit'" :maxlength="8"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" placeholder="当前公里数" /><label
												class="i-r-text">公里</label>
										</view>
									</view>
								</u-form-item>
								<u-form-item>
									<view class="i-row">
										<view class="r-title">记账日期</view>
										<view class="r-con">
											<MyDateTime :name="'qtjz.jzDate'" :showType="1" :datePlaceholder="'记账日期'"
												:dateTime="fm.qtjz.jzDate" @myClick="setDateTime"></MyDateTime>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">记账金额</view>
										<view class="r-con">
											<u-input v-model="fm.qtjz.jzMoney" :type="'digit'" :maxlength="6"
												:input-align="'right'" :clearable="false"
												:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入记账金额'" /><label
												class="i-r-text">元</label>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row">
										<view class="r-title">支付方式</view>
										<view class="r-con">
											<MySelect :title="'支付方式'" :name="'qtjz.payWay'" :list="fm.payWayList"
												:defval="fm.qtjz.payWay" @seledItem="mySeledMd"></MySelect>
										</view>
									</view>
								</u-form-item>

								<u-form-item>
									<view class="i-row-textarea">
										<view class="r-title">备注</view>
										<view class="r-con">
											<u-input v-model="fm.qtjz.jzRemark" :type="'textarea'"
												:custom-style="{'color': '#00C3CE'}"
												:placeholderStyle="'color: #f000000;'" :clearable="false"
												:auto-height="true" :height="150" :maxlength="200"
												:placeholder="'请填写备注，最多输入200个字（选填）'" />
										</view>
									</view>
								</u-form-item>

								<u-form-item :border-bottom="false">
									<view class="i-row-textarea">
										<view class="r-title">凭证图片<label class="r-title-tip">（最多上传6张图片）</label></view>
										<view class="r-con">
											<u-upload ref="qtjzUf" width="200" height="200" max-count="6"
												:file-list="fm.qtjz.uflist" :action="fm.ufAction" :header="fm.ufHeader"
												:name="'file'" :form-data="{ftype: 'BACK_SET_DATA_IMG', }"
												:max-size="1024*1024*30"></u-upload>
										</view>
									</view>
								</u-form-item>
							</view>
						</view>
					</u-form>
				</u-collapse-item>

			</u-collapse>
			<view class="fm-bottom-btns">
				<view class="find-bz-btn" @click="goAllBzList">查看报账</view>
				<view class="sub-bz-btn" @click="submitFm">提交报账</view>
			</view>
		</view>


		<u-tabbar :list="tabbar"></u-tabbar>
		<PlateNumList v-if="carMd.show" :defval="plateNum" @myClick="setCarPlateNum"></PlateNumList>

		<!-- <u-popup class="my-popup-md" v-model="routeBzMd.show" mode="right" width="100%" :safe-area-inset-bottom="true"
			:mask-close-able="false" :custom-style="{'background': '#efefef'}">
			<view class="md-content">
				<AdupRouteBz :myData="dg.order" @myClick="showRouteBzMd"></AdupRouteBz>
			</view>
		</u-popup> -->

		<u-toast ref="qtoast" />
	</view>
</template>

<script>
	import ListTools from '@/components/list-tools/list-tools.vue';
	import PlateNumList from '@/components/plate-num-list/plate-num-list.vue';
	import MySelect from '@/components/my-select/my-select.vue';
	import MyDateTime from '@/components/my-date-time/my-date-time.vue';
	// import AdupRouteBz from './adup-route-bz/adup-route-bz.vue';

	export default {
		components: {
			ListTools,
			PlateNumList,
			MySelect,
			MyDateTime,
			// AdupRouteBz
		},
		data() {

			let jywaylist = [{
					val: 'ACCOUNTING',
					text: '记账'
				},
				{
					val: 'CASH',
					text: '现金'
				},
			];

			return {
				getMaintenanceTips_data:'',
				wxjzfm_open: false,
				scjzfm_open: false,
				tabbar: '',
				count: 0,
				// 开始时间
				startTime: this.U.getMonthFirstDay(new Date(), 1).split(' ')[0],
				// 结束时间
				endTime: this.U.getMonthLastDay(new Date(), 1).split(' ')[0],
				// 车辆搜索弹框
				carMd: {
					show: false,
					myPlateNum: uni.getStorageSync(this.C.luser).plateNum
				},
				// 车牌号
				plateNum: '',
				// 列表参数对象
				dg: {
					// 请求参数对象
					ps: {
						// 页码, 页大小
						page: {
							pageNum: 1,
							pageSize: 20,
						},
						// 车牌号
						plateNum: ''
					},
					// 列表数组
					list: [],
					// 加载状态
					load: false,
					// 选中的订单项
					selId: null,
					// 选中的订单
					order: null,
					// 查看更多
					moreId: null
				},
				// 行程收支报账弹框
				routeBzMd: {
					show: false
				},

				// 非行程收支表单列表
				fmList: [],
				fm: {
					// 文件上传地址
					ufAction: this.C.upfileUrl,
					// 文件上传请求头信息
					ufHeader: {
						'token': uni.getStorageSync(this.C.uuid)
					},

					// 加油方式列表
					jyWayList: [],
					// 加油站列表
					jyStationList: [],
					// 维修站列表
					wxStationList: [],
					// 支付方式列表
					payWayList: jywaylist,
					isMaintenanceList: [{
							val: '0',
							text: '否'
						},
						{
							val: '1',
							text: '是'
						},
					],
					// 加油记账
					jyjz: {
						// 记账类型
						jzType: 'JYJZ',
						// 修改id
						id: '',
						// 车辆当前公里数
						currentKilo: '',
						// 加油方式
						jyWay: {
							val: 'XJ_JY',
							text: '现金加油'
						},
						// 加油站
						jyStation: {
							val: '',
							text: ''
						},
						// 加油金额
						reimMoney: '',
						// 加油数量
						jyCount: '',
						// 加油日期
						jyDate: {
							date: '',
							time: ''
						},
						// 加油备注
						remark: '',
						// 图片id
						fids: [],
						// 默认图片数组
						uflist: []
					},

					// 维修记账
					wxjz: {
						// 记账类型
						jzType: 'WXJZ',
						// 修改id
						id: '',
						// 车辆当前公里数
						currentKilo: '',
						// 维修站
						wxStation: {
							val: '',
							text: ''
						},
						// 支付方式
						wxPayWay: jywaylist[1],
						isMaintenance: {
							val: '0',
							text: '否'
						},
						// 维修金额
						reimMoney: '',
						// 维修项详情
						// wxItems: [{
						// 	label: '',
						// 	reimMoney: ''
						// }],
						// 维修时间
						wxDate: {
							date: '',
							time: ''
						},
						// 维修备注
						remark: '',
						// 图片id
						fids: [],
						// 默认图片数组
						uflist: []
					},
					// 审车记账
					scjz: {
						// 记账类型
						jzType: 'SCJZ',
						// 修改id
						id: '',
						// 车辆当前公里数
						currentKilo: '',
						// 金额
						reimMoney: '',

						// 维修备注
						remark: '',

						// 支付方式
						wxPayWay: jywaylist[1],
						isMaintenance: {
							val: '0',
							text: '否'
						},
						// 时间
						scDate: {
							date: '',
							time: ''
						},
						// 时间
						scDate2: {
							date: '',
							time: ''
						},
						remindDays: '',
						expireTime: '',
						// 图片id
						fids: [],
						// 默认图片数组
						uflist: [],



					},

					// 月停车费记账
					ytcf: {
						// 记账类型
						jzType: 'YTCF',
						// 修改id
						id: '',
						// 当前公里数
						currentKilo: '',
						// 月停车开始时间
						costStartTime: {
							date: '',
							time: ''
						},
						// 月停车结束时间
						costEndTime: {
							date: '',
							time: ''
						},
						// 记账金额
						reimMoney: '',
						// 支付方式
						payWay: jywaylist[1],
						// 记账备注
						remark: '',
						// 图片id
						fids: [],
						// 默认图片数组
						uflist: []
					},

					// 月洗车费记账
					yxcf: {
						// 记账类型
						jzType: 'YXCF',
						// 修改id
						id: '',
						// 当前公里数
						currentKilo: '',
						// 月停车开始时间
						costStartTime: {
							date: '',
							time: ''
						},
						// 月停车结束时间
						costEndTime: {
							date: '',
							time: ''
						},
						// 记账金额
						jzMoney: '',
						// 支付方式
						payWay: jywaylist[1],
						// 记账备注
						jzRemark: '',
						// 图片id
						fids: [],
						// 默认图片数组
						uflist: []
					},



					// 其他记账
					qtjz: {
						// 记账类型
						jzType: 'QTJZ',
						// 修改id
						id: '',
						// 当前公里数
						currentKilo: '',
						// 记账日期
						jzDate: {
							date: '',
							time: ''
						},
						// 记账金额
						jzMoney: '',
						// 支付方式
						payWay: jywaylist[1],
						// 记账备注
						jzRemark: '',
						// 图片id
						fids: [],
						// 默认图片数组
						uflist: []
					},

				}
			}
		},
		onReady() {
			const that = this;

			console.log('请求地址', this.fm.ufAction);
		},
		onLoad() {
			let lrole = uni.getStorageSync('lrole');
			if (lrole.roleName == '驾驶员') {
				this.tabbar = [{
						iconPath: "/static/tabbar/order.png",
						selectedIconPath: "/static/tabbar/order-sel.png",
						text: '订单',
						isDot: false,
						pagePath: "/pages/tabbar/order-list/order-list"
					},
					{
						iconPath: "/static/tabbar/bz.png",
						selectedIconPath: "/static/tabbar/bz-sel.png",
						text: '报账',
						isDot: false,
						pagePath: "/pages/tabbar/order-bz-list/order-bz-list"
					}, {
						iconPath: "/static/tabbar/user.png",
						selectedIconPath: "/static/tabbar/user-sel.png",
						text: '我的',
						isDot: false,
						pagePath: "/pages/tabbar/my/my"
					}
				]
			} else {
				this.tabbar = [{
						iconPath: "/static/tabbar/order.png",
						selectedIconPath: "/static/tabbar/order-sel.png",
						text: '订单',
						isDot: false,
						pagePath: "/pages/tabbar/order-list/order-list"
					},
					{
						iconPath: "/static/tabbar/notice.png",
						selectedIconPath: "/static/tabbar/bz-sel.png",
						text: '抢单',
						isDot: false,
						pagePath: "/pages/tabbar/my-notice/my-notice"
					},
					{
						iconPath: "/static/tabbar/bz.png",
						selectedIconPath: "/static/tabbar/notice-sel.png",
						text: '报账',
						isDot: false,
						pagePath: "/pages/tabbar/order-bz-list/order-bz-list"
					}, {
						iconPath: "/static/tabbar/user.png",
						selectedIconPath: "/static/tabbar/user-sel.png",
						text: '我的',
						isDot: false,
						pagePath: "/pages/tabbar/my/my"
					}
				]
			}
			const that = this,
				U = that.U;

			// 备份一份空的表单数据，方便清空表单
			for (let a in that.fm) {
				let f = U.scopy(that.fm[a]);
				// 存在记账类型属性才验证
				if (f.jzType) that.fmList.push(f);
			}

			// 使用用户自己设置的车辆
			let myCar = uni.getStorageSync(that.C.my_car);
			if (!myCar) myCar = uni.getStorageSync(that.C.luser).plateNum;
			that.plateNum = myCar;

			let res = that.$u.api.getAllNotRouteMoneyTypes({});
			console.log('同步请求', res);
			// 获取非行程报账基础数据
			that.getUnRouteBzBaseData();
		},
		computed: {
			// 报账订单列表高度
			bzOrderListHeight: function() {
				const that = this,
					len = that.dg.list.length;
				if (len <= 5) { // 无数据
					return '180px';
				} else if (len > 0 && len <= 5) {
					return (50 * len + 70) + 'px';
				} else {
					return '40vh';
				}
			},
			// 维修项总金额
			wxTotalMoney: function() {
				let total = 0;
				if (this.fm && this.fm.wxjz.wxItems) {
					this.fm.wxjz.wxItems.forEach(it => {
						total += Number(it.money);
					});
				}
				// this.fm.wxjz.wxMoney = total;
				return total;
			}
		},
		methods: {
			// 日期选择事件回调
			selAlSeDate(e) {
				// console.log('起止日期选择事件', e);

				this.startTime = e.st;
				this.endTime = e.et;

				// 重新查询
				this.getOrderBzList(1, 20);
			},
			// 设置车牌
			setCarPlateNum(e) {
				const that = this;

				if (e.show) {

				} else {
					if (e.obj) {
						// 缓存车辆
						uni.setStorageSync(that.C.my_car, e.obj);

						that.plateNum = e.obj;

						// 重新查询订单数据
						that.$refs.paging.reload();
					}
				}
				that.carMd.show = e.show;

				console.log('子组件获取的车牌', e);
			},
			// 获取-订单报账列表
			getOrderBzList(pageNo, pageSize) {
				let that = this,
					U = that.U,
					dg = that.dg,
					ps = dg.ps;

				ps.page.pageNum = pageNo;
				ps.page.pageSize = pageSize;
				ps.plateNum = that.plateNum;
				timeType: '0',
					ps.startTime = that.startTime + ' ' + '00:00:00'
				ps.endTime = that.endTime + ' ' + '23:59:59'
				// console.log(JSON.stringify(ps))
				that.$u.api.getBzOrderList(ps).then(res => {
					if (res.code == 1) {

						that.$refs.paging.complete(res.data.list);
						that.count = res.data.total
					} else {
						that.$refs.paging.complete([]);
					}
				});
			},
			// 订单选中事件
			selBzItem(obj) {
				let that = this,
					dg = that.dg;
				console.log('选中的订单', obj);

				// 选中单选按钮
				dg.selId = obj.id;
				// 设置-选中的订单对象
				dg.order = obj;

				console.log('复制后的订单', that.dg.order);
			},
			// 显示行程收支报账弹框
			showRouteBzMd(e) {
				const that = this,
					md = that.routeBzMd;
				let orderNum = e.orderNum
				let id = e.id
				uni.navigateTo({
					url: '/bz-man/adup-route-bz2/adup-route-bz?orderNum=' + orderNum + '&id=' + id + '&plateNum=' +
						that.plateNum
				})
				// if (e.show) { // 显示
				// 	md.show = e.show;
				// } else { // 隐藏
				// 	md.show = e.show;
				// }
			},
			// 无需报账/完成报账
			setRouteBzState(obj) {
				let that = this,
					U = that.U;
				console.log('当前选择订单', obj);
				U.qconfim('当前订单确认[无需报账/完成报账]吗？如以后还需报账请联系业务员。', function(e) {
					if (e.confirm) {
						that.$u.api.setOrderBzState({
							id: obj.order.id
						}).then((res) => {
							if (res.code != 1) {
								U.qinfo(res.msg);
							} else {
								U.qinfo(res.msg);

								// 直接删除当前订单
								that.dg.list.splice(obj.index, 1);
							}
						});
					}
				});
			},



			/***********非团上报账***************/
			async getUnRouteBzBaseData() {
				const that = this,
					U = that.U,
					fm = that.fm;
				// 设置-加油方式
				let jyWays = [{
						id: 'XJ_JY',
						text: '现金加油',
					},
					{
						id: 'YP_JY',
						text: '油票加油',
					},
					{
						id: 'YGC_JY',
						text: '油罐车加油',
					},
					{
						id: 'CZK_JY',
						text: '充值卡加油',
					},
				]
				fm.jyWayList = [];
				jyWays.forEach(it => {
					fm.jyWayList.push({
						val: it.id,
						text: it.text
					});
				});
				let res = await that.$u.api.findComboCusList({
					cusTypeMark: 'OILSTATION',
					page: {
						pageNum: 1,
						pageSize: 999,
					}
				});
				if (res.code == 1) {

					// 设置-加油站列表

					fm.jyStationList = [];
					res.data.forEach(it => {
						fm.jyStationList.push({
							val: it.id,
							text: it.cusCompanySimpleName
						});
					});

				}
				let res2 = await that.$u.api.findComboCusList({
					cusTypeMark: 'REPAIR',
					page: {
						pageNum: 1,
						pageSize: 999,
					}
				});
				if (res2.code == 1) {

					// 设置-维修站列表
					fm.wxStationList = [];
					res2.data.forEach(it => {
						fm.wxStationList.push({
							val: it.id,
							text: it.cusCompanySimpleName
						});
					});

				}

			},
			// 弹框列表选择
			mySeledMd(e) {
				console.log('父级接收子组件数据', e);
				const that = this,
					fm = that.fm;

				that._.set(fm, e.name, e.obj);

				if (e.name == 'jyjz.jyWay') {
					that.$nextTick(function() {
						// 处理新增或者删除后的高度重置
						that.$refs.uCollspan.init();
					});
				}

				console.log('设置后的值', that.fm);
			},
			// 选择日期时间
			setDateTime(e) {
				console.log('子组件的数据', e);
				let that = this,
					fm = that.fm;

				that._.set(fm, e.name, e.obj);
				console.log('设置后的值', that.fm);
			},

			/**
			 * 添加/删除-维修项
			 * @param {Object} type 操作类型 1-添加 0-删除
			 * @param {Object} index 下标
			 */
			adupWxItems(type, index) {
				let that = this,
					U = that.U,
					pklist = that.fm.wxjz.wxItems;
				console.log('传入的值', type, index);
				if (type == 0) {
					U.qconfim('确定删除吗？', function(e) {
						if (e.confirm) {
							pklist.splice(index, 1);

							// 更新高度（组件内部方法queryRect）
							setTimeout(() => {
								that.$refs.wxjzCollItem.queryRect();
								that.$refs.scjzCollItem.queryRect();
							}, 500);
						}
					});
				} else {
					pklist.push({
						label: '',
						money: ''
					});

					that.fm.wxjz.wxItems = U.scopy(pklist);


					// 更新高度（组件内部方法queryRect）
					setTimeout(() => {
						that.$refs.wxjzCollItem.queryRect();
						that.$refs.scjzCollItem.queryRect();
					}, 500);

					console.log('新增的结果', that.fm.wxjz.wxItems);
				}
			},

			// 删除图片
			removeUpFile(index, lists, name) {
				let arr = [];
				lists.forEach(it => {
					if (it.response && it.response.data) arr.push(it.response.data[0]);
				});
				this.fm.ps.fids = arr.join(',');
			},
			// 所有图片上传完成
			upFileFinish(lists, name) {
				let arr = [];
				lists.forEach(it => {
					if (it.response && it.response.data) arr.push(it.response.data[0]);
				});
				this.fm.ps.fids = arr.join(',');
			},
			// 导航-全部报账列表
			goAllBzList() {
				uni.navigateTo({
					url: '/bz-man/all-bz-list/all-bz-list'
				});
			},
			clear_btn(e) {
				let that = this
				let jywaylist = [{
						val: 'ACCOUNTING',
						text: '记账'
					},
					{
						val: 'CASH',
						text: '现金'
					},
				];
				if (e == '加油记账') {
					that.fm.jyjz.id = ''
					that.fm.jyjz.currentKilo = ''
					that.fm.jyjz.jyWay.val = ''
					that.fm.jyjz.jyWay.text = ''
					that.fm.jyjz.jyStation.val = ''
					that.fm.jyjz.jyStation.text = ''
					that.fm.jyjz.reimMoney = ''
					that.fm.jyjz.jyDate.date = ''
					that.fm.jyjz.jyDate.time = ''
					that.fm.jyjz.remark = ''
					that.fm.jyjz.fids = []
					that.fm.jyjz.uflist = []
					that.$refs['jyjz' + 'Uf'].clear();
				} else if ('维修记账') {
					that.fm.wxjz.id = ''
					that.fm.wxjz.currentKilo = ''
					that.fm.wxjz.wxStation.val = ''
					that.fm.wxjz.wxStation.text = ''
					that.fm.wxjz.wxPayWay = jywaylist[1]
					that.fm.wxjz.isMaintenance = {
						val: '0',
						text: '否'
					}


					that.fm.wxjz.reimMoney = ''
					that.fm.wxjz.wxDate.date = ''
					that.fm.wxjz.wxDate.time = ''
					that.fm.wxjz.remark = ''
					that.fm.wxjz.fids = []
					that.fm.wxjz.uflist = []
					that.$refs['wxjz' + 'Uf'].clear();
				} else if ('月停车费') {
					that.fm.ytcf.id = ''
					that.fm.ytcf.currentKilo = ''
					that.fm.ytcf.costStartTime.date = ''
					that.fm.ytcf.costStartTime.time = ''
					that.fm.ytcf.costEndTime.date = ''
					that.fm.ytcf.costEndTime.time = ''
					that.fm.ytcf.reimMoney = ''
					that.fm.ytcf.wxPayWay = jywaylist[1]
					that.fm.ytcf.remark = ''
					that.fm.ytcf.fids = []
					that.fm.ytcf.uflist = []
					that.$refs['ytcf' + 'Uf'].clear();
				} else if ('月洗车费') {
					that.fm.yxcf.id = ''
					that.fm.yxcf.currentKilo = ''
					that.fm.yxcf.costStartTime.date = ''
					that.fm.yxcf.costStartTime.time = ''
					that.fm.yxcf.costEndTime.date = ''
					that.fm.yxcf.costEndTime.time = ''
					that.fm.yxcf.reimMoney = ''
					that.fm.yxcf.wxPayWay = jywaylist[1]
					that.fm.yxcf.remark = ''
					that.fm.yxcf.fids = []
					that.fm.yxcf.uflist = []
					that.$refs['yxcf' + 'Uf'].clear();
				} else if ('其他费用') {
					that.fm.qtjz.id = ''
					that.fm.qtjz.currentKilo = ''
					that.fm.qtjz.jzDate.date = ''
					that.fm.qtjz.jzDate.time = ''

					that.fm.qtjz.jzMoney = ''
					that.fm.qtjz.wxPayWay = jywaylist[1]
					that.fm.qtjz.jzRemark = ''
					that.fm.qtjz.fids = []
					that.fm.qtjz.uflist = []
					that.$refs['qtjz' + 'Uf'].clear();
				} else if ('审车记账') {
					that.fm.scjz.id = ''
					that.fm.scjz.currentKilo = ''

					that.fm.scjz.wxPayWay = jywaylist[1]
					that.fm.scjz.expireTime = ''
					that.fm.scjz.remindDays = ''

					that.fm.scjz.reimMoney = ''
					that.fm.scjz.scDate.date = ''
					that.fm.scjz.scDate.time = ''
					that.fm.scjz.scDate2.date = ''
					that.fm.scjz.scDate2.time = ''
					that.fm.scjz.remark = ''
					that.fm.scjz.fids = []
					that.fm.scjz.uflist = []
					that.$refs['scjz' + 'Uf'].clear();
				}
			},

			// 验证所有的表单
			valAllFm() {
				const that = this,
					U = that.U,
					FV = that.FV,
					fm = that.fm,
					staffReimInfo = [];
				let fg = true,
					valFmList = [];

				if (fg) {
					for (let b = 0; b < that.fmList.length; b++) {

					}

					that.fmList.forEach(it => {
						// 当前记账类型表单参数对象名称
						let jzt = it.jzType.toLowerCase();
						// 当前记账表单参数对象
						let currfm = U.scopy(fm[jzt]);

						// 新表单对象与基类表单对象不同，表示新表单存在新参数
						if (!that._.isEqual(it, currfm)) valFmList.push(it.jzType);
					});


				}

				// 只要有一个表单存在新参数，就需要验证
				if (valFmList.length > 0) {
					// 验证加油报账表单
					if (fg && valFmList.findIndex(it => it == fm.jyjz.jzType) != -1) {
						let ps = U.scopy(fm.jyjz),
							p = {};
						if (fg) {
							p.jzType = ps.jzType;
							p.moneyTypeId = 8;
							p.id = ps.id;
						}

						// 111




						if (fg) {
							let plateNum = that.plateNum;
							if (!plateNum) {
								fg = U.qinfo('请选择加油辆车');
							} else if (plateNum.length > 8) {
								fg = U.qinfo('车牌号格式错误');
							} else {
								p.plateNum = plateNum;
							}
						}

						if (fg) {
							let currentKilo = ps.currentKilo;
							if (!currentKilo || currentKilo < 0) {
								fg = U.qinfo('[加油车辆当前公里数]不能为空');
							} else {
								p.currentKilo = currentKilo;
							}
						}

						if (fg) {
							let jyWay = ps.jyWay.val;
							if (!jyWay) {
								fg = U.qinfo('[加油方式]不能为空');
							} else {
								p.oilWay = jyWay;
							}
						}
						if (fg) {
							let jyCount = ps.jyCount;
							if (!jyCount || jyCount == 0) {
								fg = U.qinfo('[加油数量]不能为空或0');
							} else if (!FV.isFloat(jyCount)) {
								fg = U.qinfo('[加油数量]格式错误');
							} else {
								p.oilRise = jyCount;
							}
						}

						if (p.oilWay != 'XJ_JY') { // 油票加油
							if (fg) {
								let jyStation = ps.jyStation.val;
								if (!jyStation) {
									fg = U.qinfo('[加油站]不能为空');
								} else {
									p.stationId = jyStation;
								}
							}



							if (fg) {
								let reimMoney = ps.reimMoney;
								if (!reimMoney || reimMoney == 0) {
									fg = U.qinfo('[加油金额]不能为空或0');
								} else if (!FV.isFloat(reimMoney)) {
									fg = U.qinfo('[加油金额]格式错误');
								} else {
									p.reimMoney = reimMoney;
								}
							}
						} else { // 现金加油
							if (fg) {
								let reimMoney = ps.reimMoney;
								if (!reimMoney || reimMoney == 0) {
									fg = U.qinfo('[加油金额]不能为空或0');
								} else if (!FV.isFloat(reimMoney)) {
									fg = U.qinfo('[加油金额]格式错误');
								} else {
									p.reimMoney = reimMoney;
								}
							}
						}

						if (fg) {
							let jyDate = ps.jyDate.date;
							if (!jyDate) {
								//fg = U.qinfo('[加油日期]不能为空');
							} else if (U.str2date(jyDate + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[加油日期]不能大于当前时间');
							} else {
								p.payTime = jyDate;
							}
						}

						if (fg) {
							let remark = ps.remark;
							if (remark.length > 200) {
								fg = U.qinfo('[加油备注]最多填写200个字');
							} else {
								p.remark = remark;
							}
						}



						if (fg) {
							let uflist = that.$refs.jyjzUf.lists;
							if (uflist.length == 0) {
								fg = U.qinfo('至少需要上传一张加油小票图片');
							} else {
								let fids = [];
								uflist.forEach(it => {
									if (it.response && it.response.data) fids.push(it.response.data.file.url);
								});

								console.log('加油记账图片', uflist, fids);

								if (fids.length == 0) {
									fg = U.qinfo('上传图片' + uflist.length + '张，成功' + fids.length + '张');
								} else {
									that.$u.api.getMaintenanceTips({
										currentKilo: ps.currentKilo,
										plateNum: that.plateNum,
									}).then((res) => {
										if (res.code != 1) {
											that.getMaintenanceTips_data = res.msg
										} else {
										
											that.getMaintenanceTips_data = ''


										}
									});
									p.reimVoucherUrl = fids.join(',');

									staffReimInfo.push(p);
								}
							}
						}
					}

					// 验证维修报账表单
					if (fg && valFmList.findIndex(it => it == fm.wxjz.jzType) != -1) {
						let ps = that.fm.wxjz,
							p = {};
						if (fg) {
							p.jzType = ps.jzType;
							p.id = ps.id;
							p.moneyTypeId = 9;
						}

						if (fg) {
							let plateNum = that.plateNum;
							if (!plateNum) {
								fg = U.qinfo('请选择维修辆车');
							} else if (plateNum.length > 8) {
								fg = U.qinfo('车牌号格式错误');
							} else {
								p.plateNum = plateNum;
							}
						}

						if (fg) {
							let currentKilo = ps.currentKilo;
							if (!currentKilo || currentKilo < 0) {
								fg = U.qinfo('[维修车辆当前公里数]不能为空');
								that.wxjzfm_open = true
							} else {
								p.currentKilo = currentKilo;
							}
						}

						if (fg) {
							let wxStation = ps.wxStation.val;
							if (!wxStation) {
								fg = U.qinfo('[维修站]不能为空');
							} else {
								p.stationId = wxStation;
							}
						}

						if (fg) {
							let wxPayWay = ps.wxPayWay.val;
							if (!wxPayWay) {
								fg = U.qinfo('[支付方式]不能为空');
							} else {
								p.payWay = wxPayWay;
							}
						}
						if (fg) {
							let isMaintenance = ps.isMaintenance.val;
							if (!isMaintenance) {
								fg = U.qinfo('[是否保养]不能为空');
							} else {
								p.isMaintenance = isMaintenance;
							}
						}



						if (fg) {
							let wxDate = ps.wxDate.date;
							if (!wxDate) {
								//fg = U.qinfo('[维修日期]不能为空');
							} else if (U.str2date(wxDate + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[维修日期]不能大于当前时间');
							} else {
								p.payTime = wxDate;
							}
						}
						if (fg) {
							let reimMoney = ps.reimMoney;
							if (!reimMoney || reimMoney == 0) {
								fg = U.qinfo('[维修金额]不能为空或0');
							} else if (!FV.isFloat(reimMoney)) {
								fg = U.qinfo('[维修金额]格式错误');
							} else {
								p.reimMoney = reimMoney;
							}
						}


						if (fg) {
							let remark = ps.remark;
							if (remark.length > 200) {
								fg = U.qinfo('[维修备注]最多填写200个字');
							} else {
								p.remark = remark;
							}
						}

						if (fg) {
							let uflist = that.$refs.wxjzUf.lists;
							if (uflist.length == 0) {
								fg = U.qinfo('至少需要上传一张维修清单小票图片');
							} else {
								let fids = [];
								uflist.forEach(it => {
									if (it.response && it.response.data) fids.push(it.response.data.file.url);
								});

								console.log('维修记账图片', uflist, fids);

								if (fids.length == 0) {
									fg = U.qinfo('上传图片' + uflist.length + '张，成功' + fids.length + '张');
								} else {
									p.reimVoucherUrl = fids.join(',');

									staffReimInfo.push(p);

								}
							}
						}
					}

					// 验证审车报账表单
					if (fg && valFmList.findIndex(it => it == fm.scjz.jzType) != -1) {
						let ps = that.fm.scjz,
							p = {};
						if (fg) {
							p.jzType = ps.jzType;
							p.id = ps.id;
							p.moneyTypeId = 23;
						}

						if (fg) {
							let plateNum = that.plateNum;
							if (!plateNum) {
								fg = U.qinfo('请选择审车辆车');
							} else if (plateNum.length > 8) {
								fg = U.qinfo('车牌号格式错误');
							} else {
								p.plateNum = plateNum;
							}
						}

						if (fg) {
							let currentKilo = ps.currentKilo;
							if (!currentKilo || currentKilo < 0) {
								fg = U.qinfo('[审车车辆当前公里数]不能为空');
								that.scjzfm_open = true
							} else {
								p.currentKilo = currentKilo;
							}
						}



						if (fg) {
							let wxPayWay = ps.wxPayWay.val;
							if (!wxPayWay) {
								fg = U.qinfo('[支付方式]不能为空');
							} else {
								p.payWay = wxPayWay;
							}
						}




						if (fg) {
							let scDate = ps.scDate.date;
							if (!scDate) {
								//fg = U.qinfo('[到期时间]不能为空');
							} else if (U.str2date(scDate + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[支付时间]不能大于当前时间');
							} else {
								p.expireTime = scDate + ' 00:00:00';
							}
						}
						if (fg) {
							let scDate2 = ps.scDate2.date;
							p.payTime = scDate2 + ' 00:00:00';
						}

						if (fg) {
							let remindDays = ps.remindDays;
							if (!remindDays || remindDays < 0) {
								fg = U.qinfo('[审车车辆提前提醒天数’]不能为空');
							} else {
								p.remindDays = remindDays;
							}
						}

						if (fg) {
							let reimMoney = ps.reimMoney;
							if (!reimMoney || reimMoney == 0) {
								fg = U.qinfo('[审车金额]不能为空或0');
							} else if (!FV.isFloat(reimMoney)) {
								fg = U.qinfo('[审车金额]格式错误');
							} else {
								p.reimMoney = reimMoney;
							}
						}


						if (fg) {
							let remark = ps.remark;
							if (remark.length > 200) {
								fg = U.qinfo('[审车备注]最多填写200个字');
							} else {
								p.remark = remark;
							}
						}

						if (fg) {
							let uflist = that.$refs.scjzUf.lists;
							if (uflist.length == 0) {
								fg = U.qinfo('至少需要上传一张审车清单小票图片');
							} else {
								let fids = [];
								uflist.forEach(it => {
									if (it.response && it.response.data) fids.push(it.response.data.file.url);
								});

								console.log('审车记账图片', uflist, fids);

								if (fids.length == 0) {
									fg = U.qinfo('上传图片' + uflist.length + '张，成功' + fids.length + '张');
								} else {
									p.reimVoucherUrl = fids.join(',');

									staffReimInfo.push(p);

								}
							}
						}
					}


					// 验证-月停车费报账表单
					if (fg && valFmList.findIndex(it => it == fm.ytcf.jzType) != -1) {
						let ps = U.scopy(fm.ytcf),
							p = {};
						if (fg) {
							p.jzType = ps.jzType;
							p.id = ps.id;
							p.moneyTypeId = 21;
						}
						if (fg) {
							let currentKilo = ps.currentKilo;
							if (!currentKilo || currentKilo < 0) {
								fg = U.qinfo('[当前公里数]不能为空');
							} else {
								p.currentKilo = currentKilo;
							}
						}
						if (fg) {
							let plateNum = that.plateNum;
							if (!plateNum) {
								fg = U.qinfo('请选择报账辆车');
							} else if (plateNum.length > 8) {
								fg = U.qinfo('车牌号格式错误');
							} else {
								p.plateNum = plateNum;
							}
						}

						if (fg) {
							let costStartTime = ps.costStartTime.date;
							if (!costStartTime) {
								fg = U.qinfo('[停车开始日期]不能为空');
							} else if (U.str2date(costStartTime + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[停车开始日期]不能大于当前时间');
							} else {
								p.costStartTime = costStartTime;
							}
						}

						if (fg) {
							let costEndTime = ps.costEndTime.date;
							if (!costEndTime) {
								fg = U.qinfo('[停车结束日期]不能为空');
							} else if (U.str2date(costEndTime + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[停车结束日期]不能大于当前时间');
							} else {
								if (U.str2date(costEndTime + ' 00:00:00').getTime() < U.str2date(ps.costStartTime +
										' 00:00:00')
									.getTime()) {
									fg = U.qinfo('[停车结束日期]不能小于[停车开始日期]');
								} else {
									p.costEndTime = costEndTime;
								}
							}
						}

						if (fg) {
							let reimMoney = ps.reimMoney;
							if (!reimMoney && reimMoney != 0) {
								fg = U.qinfo('[停车费用]不能为空');
							} else if (!FV.isFloat(reimMoney)) {
								fg = U.qinfo('[停车费用]格式错误');
							} else {
								p.reimMoney = reimMoney;
							}
						}

						if (fg) {
							let payWay = ps.payWay.val;
							if (!payWay) {
								fg = U.qinfo('[支付方式]不能为空');
							} else {
								p.payWay = payWay;
							}
						}

						if (fg) {
							let remark = ps.remark;
							if (remark && remark.length > 200) {
								fg = U.qinfo('[备注]最多填写200个字');
							} else {
								p.remark = remark;
							}
						}

						if (fg) {
							let uflist = that.$refs.ytcfUf.lists;
							if (uflist.length == 0) {
								fg = U.qinfo('至少需要上传一张月停车费凭证图片');
							} else {
								let fids = [];
								uflist.forEach(it => {
									if (it.response && it.response.data) fids.push(it.response.data.file.url);
								});
								if (fids.length == 0) {
									fg = U.qinfo('上传图片' + uflist.length + '张，成功' + fids.length + '张');
								} else {
									p.reimVoucherUrl = fids.join(',');

									staffReimInfo.push(p);
								}
							}
						}
					}

					// 验证-月洗车费报账表单
					if (fg && valFmList.findIndex(it => it == fm.yxcf.jzType) != -1) {
						let ps = U.scopy(fm.yxcf),
							p = {};
						if (fg) {
							// 月停车费
							p.jzType = ps.jzType;
							p.id = ps.id;
							p.moneyTypeId = 22;
						}
						if (fg) {
							let currentKilo = ps.currentKilo;
							if (!currentKilo || currentKilo < 0) {
								fg = U.qinfo('[当前公里数]不能为空');
							} else {
								p.currentKilo = currentKilo;
							}
						}
						if (fg) {
							let plateNum = that.plateNum;
							if (!plateNum) {
								fg = U.qinfo('请选择报账辆车');
							} else if (plateNum.length > 8) {
								fg = U.qinfo('车牌号格式错误');
							} else {
								p.plateNum = plateNum;
							}
						}

						if (fg) {
							let costStartTime = ps.costStartTime.date;
							if (!costStartTime) {
								fg = U.qinfo('[停车开始日期]不能为空');
							} else if (U.str2date(costStartTime + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[停车开始日期]不能大于当前时间');
							} else {
								p.costStartTime = costStartTime;
							}
						}

						if (fg) {
							let costEndTime = ps.costEndTime.date;
							if (!costEndTime) {
								fg = U.qinfo('[停车结束日期]不能为空');
							} else if (U.str2date(costEndTime + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[停车结束日期]不能大于当前时间');
							} else {
								if (U.str2date(costEndTime + ' 00:00:00').getTime() < U.str2date(ps.costStartTime +
										' 00:00:00')
									.getTime()) {
									fg = U.qinfo('[停车结束日期]不能小于[停车开始日期]');
								} else {
									p.costEndTime = costEndTime;
								}
							}
						}

						if (fg) {
							let jzMoney = ps.jzMoney;
							if (!jzMoney && jzMoney != 0) {
								fg = U.qinfo('[洗车费用]不能为空');
							} else if (!FV.isFloat(jzMoney)) {
								fg = U.qinfo('[洗车费用]格式错误');
							} else {
								p.reimMoney = jzMoney;
							}
						}

						if (fg) {
							let payWay = ps.payWay.val;
							if (!payWay) {
								fg = U.qinfo('[支付方式]不能为空');
							} else {
								p.payWay = payWay;
							}
						}

						if (fg) {
							let jzRemark = ps.jzRemark;
							if (jzRemark && jzRemark.length > 200) {
								fg = U.qinfo('[备注]最多填写200个字');
							} else {
								p.remark = jzRemark;
							}
						}

						if (fg) {
							let uflist = that.$refs.yxcfUf.lists;
							if (uflist.length == 0) {
								fg = U.qinfo('至少需要上传一张月洗车费凭证图片');
							} else {
								let fids = [];
								uflist.forEach(it => {
									if (it.response && it.response.data) fids.push(it.response.data.file.url);
								});
								if (fids.length == 0) {
									fg = U.qinfo('上传图片' + uflist.length + '张，成功' + fids.length + '张');
								} else {
									p.reimVoucherUrl = fids.join(',');

									staffReimInfo.push(p);
								}
							}
						}
					}





					// 验证-其他记账表单
					if (fg && valFmList.findIndex(it => it == fm.qtjz.jzType) != -1) {
						let ps = U.scopy(fm.qtjz),
							p = {};
						if (fg) {
							p.jzType = ps.jzType;
							p.id = ps.id;
							p.moneyTypeId = 27;
						}
						if (fg) {
							let currentKilo = ps.currentKilo;
							if (!currentKilo || currentKilo < 0) {
								fg = U.qinfo('[当前公里数]不能为空');
							} else {
								p.currentKilo = currentKilo;
							}
						}
						if (fg) {
							let plateNum = that.plateNum;
							if (!plateNum) {
								fg = U.qinfo('请选择报账辆车');
							} else if (plateNum.length > 8) {
								fg = U.qinfo('车牌号格式错误');
							} else {
								p.plateNum = plateNum;
							}
						}

						if (fg) {
							let jzDate = ps.jzDate.date;
							if (!jzDate) {
								fg = U.qinfo('[记账日期]不能为空');
							} else if (U.str2date(jzDate + ' 00:00:00').getTime() > new Date().getTime()) {
								fg = U.qinfo('[记账日期]不能大于当前时间');
							} else {
								p.payTime = jzDate;
							}
						}

						if (fg) {
							let jzMoney = ps.jzMoney;
							if (!jzMoney && jzMoney != 0) {
								fg = U.qinfo('[记账金额]不能为空');
							} else if (!FV.isFloat(jzMoney)) {
								fg = U.qinfo('[记账金额]格式错误');
							} else {
								p.reimMoney = jzMoney;
							}
						}

						if (fg) {
							let payWay = ps.payWay.val;
							if (!payWay) {
								fg = U.qinfo('[支付方式]不能为空');
							} else {
								p.payWay = payWay;
							}
						}

						if (fg) {
							let jzRemark = ps.jzRemark;
							if (jzRemark && jzRemark.length > 200) {
								fg = U.qinfo('[备注]最多填写200个字');
							} else {
								p.remark = jzRemark;
							}
						}

						if (fg) {
							let uflist = that.$refs.qtjzUf.lists;
							if (uflist.length == 0) {
								fg = U.qinfo('至少需要上传一其他记账张凭证图片');
							} else {
								let fids = [];
								uflist.forEach(it => {
									if (it.response && it.response.data) fids.push(it.response.data.file.url);
								});
								if (fids.length == 0) {
									fg = U.qinfo('上传图片' + uflist.length + '张，成功' + fids.length + '张');
								} else {
									p.reimVoucherUrl = fids.join(',');

									staffReimInfo.push(p);
								}
							}
						}
					}
				}

				if (valFmList.length == 0) fg = U.qinfo('至少需要提交一项报账');

				return fg ? {
					staffReimInfo: staffReimInfo
				} : fg;
			},

			// 表单提交
			submitFm() {

				let that = this,
					U = that.U;

				let ps = that.valAllFm();
				if (ps != false) {

					ps.plateNum = that.plateNum
					console.log('提交所有表单参数', JSON.stringify(ps));
					that.$u.api.adupAllUnRouteBz(ps).then((res) => {
						if (res.code != 1) {
							U.qerror(res.msg);
						} else {
							
							console.log('结果', res);
							if(that.getMaintenanceTips_data !=''){
								U.qinfo(that.getMaintenanceTips_data);
							}else{
								U.qinfo(res.msg);
							}
							that.getMaintenanceTips_data = ''
							
							let jywaylist = [{
									val: 'ACCOUNTING',
									text: '记账'
								},
								{
									val: 'CASH',
									text: '现金'
								},
							];
							that.fm.wxjz.id = ''
							that.fm.wxjz.currentKilo = ''
							that.fm.wxjz.wxStation.val = ''
							that.fm.wxjz.wxStation.text = ''
							that.fm.wxjz.wxPayWay = jywaylist[1]
							that.fm.wxjz.isMaintenance = {
								val: '0',
								text: '否'
							}
							that.fm.wxjz.reimMoney = ''
							that.fm.wxjz.wxDate.date = ''
							that.fm.wxjz.wxDate.time = ''
							that.fm.wxjz.remark = ''
							that.fm.wxjz.fids = []
							that.fm.wxjz.uflist = []


							// 循环重置表单
							that.fmList.forEach(it => {
								// 当前记账类型表单参数对象名称
								let jzt = it.jzType.toLowerCase();

								let jzType = that.fm[jzt].jzType;
								if (jzType) {
									that.fm[jzt] = U.scopy(it);

									// 清空维修详情的数据
									// if (jzType == 'WXJZ') {
									// 	that.fm[jzt].wxItems = [{
									// 		label: '',
									// 		money: ''
									// 	}];
									// }

									// 清空对应文件
									that.$refs[jzt + 'Uf'].clear();
								}
							});
						}
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #efefef;
	}

	.order-bz-list {
		padding-top: 10rpx;
		min-height: 100vh;

		.box {
			background: #FFFFFF;
			box-shadow: 0 2rpx 3rpx rgba(0, 0, 0, 0.1);
			margin: 0rpx 10rpx 20rpx 10rpx;
			padding: 10rpx 20rpx;
			position: relative;
			border-radius: 12rpx;
		}

		.bz-list {
			height: 40vh;

			.sel-plate-num {
				height: 50rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				padding: 8rpx;
				background-color: #FFFFFF;
				border-bottom: 4rpx solid #00C3CE;

				.title {
					flex: 1;
					color: #666666;
				}

				.plate-num {
					color: #00C3CE;
					font-weight: 600;
				}
			}

			.bz-item {
				width: 100%;
				line-height: 50rpx;
				border-bottom: 2rpx solid #efefef;

				.it-main {
					padding: 4rpx 10rpx 4rpx 44rpx;
					position: relative;
					display: flex;
					align-items: center;

					.it-radio {
						position: absolute;
						top: 13rpx;
						left: 0rpx;
						line-height: 50rpx;
						width: 36rpx;
					}

					.it-con {
						width: 100%;

						.it-text {
							font-size: 30rpx;
							padding-right: 50rpx;
						}

						.it-detail {
							border-top: 2rpx dashed #efefef;
							padding: 6rpx 0rpx;
							line-height: 30rpx;
							font-size: 26rpx;
							color: #666;
						}
					}

					.it-more {
						// width: 90rpx;
						font-size: 24rpx;
						color: #666;
						line-height: 60rpx;
						position: absolute;
						top: 0rpx;
						right: 0rpx;
					}
				}

				.it-btns {
					display: flex;
					align-items: center;
					justify-content: flex-end;
					padding-bottom: 10rpx;

					button {
						margin: 0rpx 10rpx;
					}
				}
			}
		}

		// 非行程收支报账
		.bz-fm {
			background: #fff;
			margin: 10rpx;
			box-shadow: 0 2rpx 3rpx rgba(0, 0, 0, 0.1);
			border-radius: 10rpx;
			padding: 20rpx;
			padding-bottom: 120rpx;

			.u-collapse-item {
				border-bottom: 1rpx solid #a6eaea;

				.u-collapse-head {
					font-size: 40rpx;
					color: #333;
					font-weight: 600;

					.u-collapse-title {
						border-left: 8rpx solid #00c3c3;
						padding-left: 10rpx;
					}
				}

			}

			.aaa {
				border-left: 8rpx solid #00c3c3;
				padding-left: 10rpx;
			}

		}

		.fm-bottom-btns {
			margin-top: 100rpx;
			display: flex;
			align-items: center;
			justify-content: space-evenly;
			width: 100%;
			border-bottom: 2rpx solid #efefef;
			border-top: 2rpx solid #efefef;
			line-height: 80rpx;
			background: #fff;
			z-index: 99;

			.find-bz-btn,
			.sub-bz-btn {
				flex: 1;
				text-align: center;
				font-size: 30rpx;
				color: #fff;
				font-weight: 600;
			}

			.find-bz-btn {
				background-color: #18b566;
			}

			.sub-bz-btn {
				background-color: #00C3CE;
			}
		}
	}
</style>